agent: @U0AJM7X8FBR CLI - add the ability for users to create an account, upgra#18
agent: @U0AJM7X8FBR CLI - add the ability for users to create an account, upgra#18sweetmantech wants to merge 2 commits intomainfrom
Conversation
- Add `recoup accounts create --email/--wallet` — creates or retrieves account via POST /api/accounts - Add `recoup accounts upgrade` — prints the Pro upgrade URL - Add `recoup keys list` — lists API keys via GET /api/keys - Add `recoup keys create --name` — creates an API key via POST /api/keys - Add `recoup keys delete --id` — deletes an API key via DELETE /api/keys - Add `del()` to client.ts for DELETE requests with body - 18 new tests, all passing (92 total) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds two new CLI commands— Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as "accounts/keys Command"
participant Client as "HTTP Client (get/post/del)"
participant API as "Remote API"
User->>CLI: Run command with flags
CLI->>CLI: Validate options
alt validation fails
CLI->>User: print error & exit(1)
else
CLI->>Client: call get/post/del(endpoint, body?)
Client->>API: send HTTP request (GET/POST/DELETE)
API-->>Client: return JSON response
alt API indicates error
Client->>CLI: throw/error
CLI->>User: print error & exit(1)
else
CLI->>CLI: format output (table or JSON)
CLI->>User: print result
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/accounts.ts`:
- Around line 26-28: The code prints account?.account_id directly, which yields
"undefined" when the API response lacks account_id; update the handling around
the account variable (the Record<string, unknown> named account and the
console.log(account?.account_id) call) to check for the presence of account and
account.account_id and output a clear fallback or error message instead (e.g.,
"Account ID not found" or return a non-zero exit/error), so users don't see an
ambiguous "undefined".
In `@src/commands/keys.ts`:
- Around line 66-68: The current else branch prints console.log(data.message)
which can output "undefined" if message is missing; update the handler in
src/commands/keys.ts that contains the console.log(data.message) to safely fall
back to a meaningful string (e.g., data.error, data.detail, or
JSON.stringify(data)) when data.message is undefined; ensure you check for data
&& data.message first and then print the chosen fallback so the command never
prints "undefined".
- Around line 43-45: The current else branch prints data.key directly, which can
output "undefined" if the API response lacks a key; update the logic in the keys
command (the block that currently does "console.log(data.key)") to validate the
response by checking that data and data.key are present and non-empty, and if
not, print a clear explanatory message (e.g., "No key returned from API") and
exit with a non-zero status or return an error; ensure you reference and update
the same branch that currently logs data.key so callers get explicit feedback
instead of undefined.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eab26a55-85c0-44b2-8635-fd0c75876938
📒 Files selected for processing (6)
__tests__/commands/accounts.test.ts__tests__/commands/keys.test.tssrc/bin.tssrc/client.tssrc/commands/accounts.tssrc/commands/keys.ts
- accounts create: print error if account_id missing from API response - keys create: print error if key missing from API response - keys delete: fallback to data.error or JSON.stringify(data) if message is missing - add tests for all three new error cases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Automated PR from coding agent.
Prompt: @U0AJM7X8FBR CLI - add the ability for users to create an account, upgrade to pro, and create and delete their api keys
Summary by CodeRabbit
New Features
accountscommand withcreateandupgradesubcommands for managing accounts (prints upgrade URL).keyscommand withlist,create, anddeletesubcommands for managing API keys (list shows table-like output).--jsonfor JSON-formatted output.Tests